<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>锁厂广告上架</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="renderer" content="webkit">
    <link href="${pageContext.request.contextPath}/static/css/common.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/css/bootstrap.min.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/font-awesome-4.3.0/css/font-awesome.min.css"
          rel="stylesheet">
    <!-- jqgrid-->
    <link href="${pageContext.request.contextPath}/static/plugins/select2-4.0.0/dist/css/select2.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/jqGrid/css/custom.ui.jqgrid.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/layer/skin/layer.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/jqGrid/css/style.css" rel="stylesheet">
 	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/plugins/jquery.time/jquery.timepicker.min.css">
    <script src="${pageContext.request.contextPath}/static/js/jquery-1.11.3.min.js"></script>
    <script src="/static/plugins/bootstrap-3.3.5/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/layer/layer.js" type="text/javascript"></script>
    <script src="${pageContext.request.contextPath}/static/js/jquery.form.js" type="text/javascript"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/My97DatePicker/WdatePicker.js"
        type="text/javascript"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/select2-4.0.0/dist/js/select2.min.js"></script>
	<script src="${pageContext.request.contextPath}/static/plugins/jquery.time/jquery.timepicker.min.js"
        type="text/javascript"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/global.js"></script>
	<style>
	.lt,.col-sm-3,.col-sm-8{float:left}
		.form-group,.col-sm-2{*+overflow:hidden;}
		.form-group label{width:16%\9;*+width:16%;text-align:right\9;*+text-align:right;}
		.col-sm-8 .m-t2 {width:30%\9; *+width:36%;}
		.col-sm-8 textarea{*+width:98%;}
		.form-group .col-sm-8{width:66%\9;*+width:66%;}
		.form-group .form-control{*+width:95%;}
		.form-control{*+height:22px;}
		#sub{*+margin-right:10px;}
		.input-group .form-control{*+z-index:-1;}
		.form-group .form-control{*+line-height:22px;}
		.upload{*+position:relative;}
		.btn-primary{*+position:absolute;*+left:431px;*+top:-35px;*+z-index:3;}
		.m-t2  label{width:50px\9;*+width:50px;}
		.col-sm-8 .input-group{width:500px;lwidth:494px\9;}
		.input-group .col-md-1{width:44%;width:46%\9;*+width:38%;float:left;*+height:22px;*+line-height:22px;}
		.input-group .input-group-addon{width:36px;width:36px\9;*+width:36px;height:34px;height:34px\9;line-height:22px;line-height:22px\9;*+height:22px;*+line-height:22px;}
    </style>
</head>
<body>
<div class="col-sm-12">
    <form class="form-horizontal m-t" method="post" id="form"
          action="${pageContext.request.contextPath}/admin/bannerResource_editLockBanner.action" enctype="multipart/form-data">
         <input type="hidden" value="${bannerResource.sid}" name="sid">
        <div class="form-group">
            <label class="col-sm-3 control-label"><i class="require">*</i>资源名称:</label>
            <div class="col-sm-8">
                <input class="form-control" name="cName" size="30" value="${bannerResource.cName}"/>
            </div>
        </div>
        <div class="form-group" id="mTypeDiv">
            <label class="col-sm-3 col-sm-3 control-label"><i class="require">*</i>上传资源:</label>
            <div class="col-sm-8">
                <div class="input-group">
                    <input class="form-control" name="content" id="content" readonly size="30" />
                    <div class="input-group-addon upload">
                        <input class="form-control" id="upload" type="file" name="upload"
                               style="position: absolute;width: 60px;opacity: 0;"/>
                        <a class="btn btn-primary">上传</a>
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 col-sm-3 control-label">URL:</label>
            <div class="col-sm-8">
                <input class="form-control" name="cUrl" id="cUrl" size="30" value="${bannerResource.cUrl}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><i class="require">*</i>优先级:</label>
            <div class="col-sm-8">
                <select name="priority" id="priority" class="select2">
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
                    <option value="9">9</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3  control-label"><i class="require">*</i>显示日期:</label>
            <div class="col-sm-8">
                <div class="input-group">
                    <input class="inputWhite form-control col-md-1" name="timeFrom" id='timeFrom' readonly
                           onclick='WdatePicker()'/>
                    <div class="input-group-addon">至</div>
                    <input name='timeTo' id='timeTo' readonly
                           class="inputWhite form-control col-md-1" onclick='WdatePicker()'/>
                </div>
            </div>
        </div>
        
        <div class="form-group">
            <label class="col-sm-3 col-sm-3 control-label">上架人:</label>
            <div class="col-sm-8">
            	<input class="form-control" name="operator" size="30" value="${bannerResource.uname}"  disabled="disabled"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 col-sm-3 control-label">上架时间:</label>
            <div class="col-sm-8">
            	<input class="form-control" name="cTime" size="30" id="cTime" disabled="disabled" value="${bannerResource.cTime}"/>
            </div>
        </div>
    </form>
</div>
<script>
    $(function () {
    	if('${bannerResource.priority}' !=''){
    		$("#priority").val('${bannerResource.priority}');
        }else{
        	$("#priority").val(1);
        }
    	$(".select2").select2({
            minimumResultsForSearch: -1,
            width:'100%'
        });
    	if('${bannerResource.timeFrom}' !=''){
        	$("#timeFrom").val('${bannerResource.timeFrom}'.substring(0,10) );
        }else{
        	$("#timeFrom").val(curDateTime);
        }
        if('${bannerResource.timeTo}' !=''){
        	$("#timeTo").val('${bannerResource.timeTo}'.substring(0,10) );
        }else{
        	$("#timeTo").val(curDateTime);
        }
        $("#content").val('${bannerResource.content}'.substring('${bannerResource.content}'.lastIndexOf('/')+1));
        $("#upload").change(function () {
            var filename = $(this).val();
            var index = filename.lastIndexOf("\\");
            $("input[name='content']").val(filename.substring(index + 1));
        });
    });
    
</script>
</body>
</html>
